<?php

/**
 * This is the model class for table "forex_peoples_account".
 *
 * The followings are the available columns in table 'forex_peoples_account':
 * @property integer $id
 * @property integer $user_id
 * @property integer $country_id
 * @property string $email
 * @property string $email_pass
 * @property string $fw_email
 * @property string $fw_email_pass
 * @property string $first_name
 * @property string $last_name
 * @property string $street
 * @property string $city
 * @property string $region
 * @property string $postcode
 * @property string $sex
 * @property string $phone
 * @property string $day
 * @property string $month
 * @property string $year
 * @property string $passport_no
 * @property string $verification
 * @property string $username
 * @property string $password
 * @property string $link
 * @property string $proxy
 * @property string $remarks
 * @property string $last_posted_date
 * @property string $date_of_birth
 * @property string $verify_code1
 * @property string $verify_code2
 * @property integer $working
 * @property string $security_question1
 * @property string $security_answer1
 * @property string $security_question2
 * @property string $security_answer2
 * @property string $security_question3
 * @property string $security_answer3
 * @property string $account_no
 * @property string $security_no
 * @property integer $serial
 */
class ForexPeoplesAccount extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return ForexPeoplesAccount the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'forex_peoples_account';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('user_id, country_id, working, serial', 'numerical', 'integerOnly'=>true),
			array('email, email_pass, fw_email, fw_email_pass, first_name, last_name, street, city, region, postcode, sex, phone, day, month, year, passport_no, verification, username, password, link, proxy, remarks, verify_code1, verify_code2, security_question1, security_answer1, security_question2, security_answer2, security_question3, security_answer3, account_no, security_no', 'length', 'max'=>255),
			array('last_posted_date, date_of_birth', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, user_id, country_id, email, email_pass, fw_email, fw_email_pass, first_name, last_name, street, city, region, postcode, sex, phone, day, month, year, passport_no, verification, username, password, link, proxy, remarks, last_posted_date, date_of_birth, verify_code1, verify_code2, working, security_question1, security_answer1, security_question2, security_answer2, security_question3, security_answer3, account_no, security_no, serial', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'user_id' => 'User',
			'country_id' => 'Country',
			'email' => 'Email',
			'email_pass' => 'Email Pass',
			'fw_email' => 'Fw Email',
			'fw_email_pass' => 'Fw Email Pass',
			'first_name' => 'First Name',
			'last_name' => 'Last Name',
			'street' => 'Street',
			'city' => 'City',
			'region' => 'Region',
			'postcode' => 'Postcode',
			'sex' => 'Sex',
			'phone' => 'Phone',
			'day' => 'Day',
			'month' => 'Month',
			'year' => 'Year',
			'passport_no' => 'Passport No',
			'verification' => 'Verification',
			'username' => 'Username',
			'password' => 'Password',
			'link' => 'Link',
			'proxy' => 'Proxy',
			'remarks' => 'Remarks',
			'last_posted_date' => 'Last Posted Date',
			'date_of_birth' => 'Date Of Birth',
			'verify_code1' => 'Verify Code1',
			'verify_code2' => 'Verify Code2',
			'working' => 'Working',
			'security_question1' => 'Security Question1',
			'security_answer1' => 'Security Answer1',
			'security_question2' => 'Security Question2',
			'security_answer2' => 'Security Answer2',
			'security_question3' => 'Security Question3',
			'security_answer3' => 'Security Answer3',
			'account_no' => 'Account No',
			'security_no' => 'Security No',
			'serial' => 'Serial',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('user_id',$this->user_id);
		$criteria->compare('country_id',$this->country_id);
		$criteria->compare('email',$this->email,true);
		$criteria->compare('email_pass',$this->email_pass,true);
		$criteria->compare('fw_email',$this->fw_email,true);
		$criteria->compare('fw_email_pass',$this->fw_email_pass,true);
		$criteria->compare('first_name',$this->first_name,true);
		$criteria->compare('last_name',$this->last_name,true);
		$criteria->compare('street',$this->street,true);
		$criteria->compare('city',$this->city,true);
		$criteria->compare('region',$this->region,true);
		$criteria->compare('postcode',$this->postcode,true);
		$criteria->compare('sex',$this->sex,true);
		$criteria->compare('phone',$this->phone,true);
		$criteria->compare('day',$this->day,true);
		$criteria->compare('month',$this->month,true);
		$criteria->compare('year',$this->year,true);
		$criteria->compare('passport_no',$this->passport_no,true);
		$criteria->compare('verification',$this->verification,true);
		$criteria->compare('username',$this->username,true);
		$criteria->compare('password',$this->password,true);
		$criteria->compare('link',$this->link,true);
		$criteria->compare('proxy',$this->proxy,true);
		$criteria->compare('remarks',$this->remarks,true);
		$criteria->compare('last_posted_date',$this->last_posted_date,true);
		$criteria->compare('date_of_birth',$this->date_of_birth,true);
		$criteria->compare('verify_code1',$this->verify_code1,true);
		$criteria->compare('verify_code2',$this->verify_code2,true);
		$criteria->compare('working',$this->working);
		$criteria->compare('security_question1',$this->security_question1,true);
		$criteria->compare('security_answer1',$this->security_answer1,true);
		$criteria->compare('security_question2',$this->security_question2,true);
		$criteria->compare('security_answer2',$this->security_answer2,true);
		$criteria->compare('security_question3',$this->security_question3,true);
		$criteria->compare('security_answer3',$this->security_answer3,true);
		$criteria->compare('account_no',$this->account_no,true);
		$criteria->compare('security_no',$this->security_no,true);
		$criteria->compare('serial',$this->serial);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}